import { VxeFormItemProps, VxeGridPropTypes } from '@/components/VxeTable';

export const vxeTableColumns: VxeGridPropTypes.Columns = [
  // {
  //   title: '序号',
  //   type: 'seq',
  //   fixed: 'left',
  //   width: '50',
  //   align: 'center',
  // },
  // { type: 'checkbox', title: '全选', width: '80' },
  { type: 'radio', title: '请选择', width: 100 },
  {
    title: '用户名',
    field: 'userName',
  },
  {
    title: '所属角色',
    field: 'roleIds',
    cellRender: {
      name: 'ApiSelect',
      props: {
        api: '/sys/role/select',
      },
    },
  },
  {
    title: '姓名',
    field: 'realName',
  },
  {
    title: '手机号',
    field: 'mobilePhone',
  },
  {
    title: '性别',
    field: 'sex',
    cellRender: {
      name: 'ApiDict',
      props: {
        code: 'sex',
      },
    },
  },
  {
    title: '管理员类型',
    field: 'adminType',
    cellRender: {
      name: 'ApiDict',
      props: {
        code: 'sys_user_admin_type',
      },
    },
  },
  {
    width: 160,
    title: '操作',
    align: 'center',
    slots: { default: 'ACTION' },
    fixed: 'right',
  },
];

export const vxeTableFormSchema: VxeFormItemProps[] = [
  {
    field: 'm_LIKE_userName',
    title: '用户名',
    itemRender: {
      name: 'AInput',
    },
    span: 6,
  },
  {
    field: 'm_LIKE_realName',
    title: '姓名',
    itemRender: {
      name: 'AInput',
    },
    span: 6,
  },
  {
    field: 'm_LIKE_mobilePhone',
    title: '手机号',
    itemRender: {
      name: 'AInput',
    },
    span: 6,
  },
  {
    span: 12,
    align: 'right',
    className: '!pr-0',
    itemRender: {
      name: 'AButtonGroup',
      children: [
        {
          props: { type: 'primary', content: '查询', htmlType: 'submit' },
          attrs: { class: 'mr-2' },
        },
        { props: { type: 'default', htmlType: 'reset', content: '重置' } },
      ],
    },
  },
];
